package com.hzyc.springdata.jpa.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.hzyc.springdata.jpa.dao.TeacherRepository;
import com.hzyc.springdata.jpa.domain.Teacher;
import com.hzyc.springdata.jpa.service.ITeacherService;

@Service
public class TeacherServiceImpl implements ITeacherService {

	@Resource
	private TeacherRepository teaDao;

	/* (non-Javadoc)
	 * @see com.hzyc.springdata.jpa.service.impl.ITeacherService#get(int)
	 */
	@Override
	public Teacher get(int id) {
		return teaDao.findOne(id);
	}

	/* (non-Javadoc)
	 * @see com.hzyc.springdata.jpa.service.impl.ITeacherService#add(com.hzyc.springdata.jpa.domain.Teacher)
	 */
	@Override
	public Teacher add(Teacher tea) {
		return teaDao.save(tea);
	}
}
